package com.wanbangee.marksystem.service.imp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wanbangee.marksystem.dao.UClassDao;
import com.wanbangee.marksystem.entities.UClass;
import com.wanbangee.marksystem.entities.UGrade;
import com.wanbangee.marksystem.entities.USchool;
import com.wanbangee.marksystem.service.UClassService;

@Service
public class UClassServiceImp implements UClassService {
	
	@Autowired
	private UClassDao uClassDao;

	@Override
	public int updateClass(UClass uClass) {
		int updateClassState = this.uClassDao.updateClass(uClass);
		return updateClassState;
	}

	@Override
	public List<USchool> selectSchool() {
		List<USchool> lists = this.uClassDao.selectSchool();
		return lists;
	}

	@Override
	public List<UGrade> selectGradeBySchId(int schId) {
		List<UGrade> list = this.uClassDao.selectGradeBySchId(schId);
		return list;
	}

	@Override
	public List<UClass> selectClassInfoBySchIdAndGraId(int schId, int graId) {
		List<UClass> selectClassInfoBySchIdAndGraIdState = this.uClassDao.selectClassInfoBySchIdAndGraId(schId, graId);
		return selectClassInfoBySchIdAndGraIdState;
	}

	@Override
	public int insertClass(UClass uClass) {
		int insertClassState = this.uClassDao.insertClass(uClass);
		return insertClassState;
	}

	@Override
	public UClass selectClassByclaId(int claId) {
		UClass uClass = this.uClassDao.selectClassByclaId(claId);
		return uClass;
	}

	@Override
	public int deleteClass(int claId) {
		int deleteClass = this.uClassDao.deleteClass(claId);
		return deleteClass;
	}

	@Override
	public int updateClaState(int claId, int claState) {
		int updateClaState = this.uClassDao.updateClaState(claId, claState);
		return updateClaState;
	}

	@Override
	public int updateClassGrade(int claId, int graId, String graNm) {
		int updateClassGradeState = this.uClassDao.updateClassGrade(claId, graId, graNm);
		return updateClassGradeState;
	}

}
